<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="../../assets/font/iconfont.css">
    <style>
        body{
            padding-bottom: 800px;
            padding-left: 30px;
        }
        .iconfont{
            font-size: 40px;
        }
        icon-set,icon-home{
            font-family: "iconfont";
            font-size: 40px;
        }
        icon-set::before{
            content: "\e78e";
        }
        icon-home::before{
            content: "\e8ff";
        }
        .cbox{
            border: 1px solid #999;
            padding: 20px;
            margin-bottom: 10px;
        }
    </style>
</head>
<body>
    <p class="iconfont icon-set"></p>
    <icon-set></icon-set>
    <hr>
    <div id="app">
        <h4>vue定义忽略标签操作</h4>
        <p>通过全局配置 app.config.compilerOptions.isCustomElement 设置需要被忽略的自定义标签</p>
        <P>取值：(tag: string) => boolean ; 当方法返回true表示标签为自定义标签，返回false为组件标签【w3c内置标签名不受影响】</P>
        <p>取值方法由vue模板转换时解析标签时自动调用</p>
        <icon-set></icon-set>
        <icon-home></icon-home>
        <hr>
        <child-comp></child-comp>
    </div>
    <script type="module">
        // 加载 Vue3 的ESM 模块文件
        import { createApp } from "../../assets/vue3/vue.esm-browser.js"
        const app = createApp({
            data(){
                return {
                    
                }
            },
            components: {
                ChildComp:{
                    template:`
                        <div class="cbox">
                            <p>组件ChildComp</p>
                        </div>
                    `
                },
            },
        })
        app.config.compilerOptions.isCustomElement = function(tag){
            // console.log(1,tag);
            // return true;
            // if(tag=="icon-set"){
            //     return true
            // }
            return tag.startsWith("icon-")
        }
        
        app.mount("#app")
    </script>
</body>
</html>